//
//  printDetailVC.m
//  BeautyPicture
//
//  Created by 沈振邦 on 15/11/25.
//  Copyright © 2015年 szb. All rights reserved.
//

#import "printDetailVC.h"
#import "AccountTool.h"
#import "BPProductPopUpImage.h"
#import "UIViewController+MJPopupViewController.h"
#import "BPImageTool.h"

#define pageShowBgColor  BPColor(48, 48, 48)

@interface printDetailVC ()

@end

@implementation printDetailVC

- (void)viewDidLoad {
    [super viewDidLoad];
    
    _popImage = [[BPProductPopUpImage alloc] initWithFrame:CGRectMake(0, 0, BPScreenW, BPScreenH)];
    _popImage.showBigImage.contentMode = UIViewContentModeScaleAspectFit;
    // Do any additional setup after loading the view.
}

- (void)showBigImage:(NSString *)imageStr
{
    BPImageTool *imageTool = [[BPImageTool alloc] init];
    [imageTool loadProcessImage:imageStr withVC:self addPopView:_popImage];
}

- (void)webViewDidStartLoad:(UIWebView *)webView{
    self.context = [webView valueForKeyPath:@"documentView.webView.mainFrame.javaScriptContext"];
    
    // 打印异常
    self.context.exceptionHandler =
    ^(JSContext *context, JSValue *exceptionValue)
    {
        context.exception = exceptionValue;
        BPLog(@"%@", exceptionValue);
    };
    
    self.context[@"api"] = self;
}

- (NSDictionary *)getjaveSpritObject
{
    //NSLog(@"%@",_jsObjc);
    return _jsObjc;
}

- (NSString *)getUserFace{
    return [AccountTool account].face;
}

- (void)dianzan:(NSString *)type :(NSString *)showID
{
    _block(type,showID);
}

- (void)comment:(NSString *)type :(NSString *)showID
{
    _block(type,showID);
}

- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}

/*
#pragma mark - Navigation

// In a storyboard-based application, you will often want to do a little preparation before navigation
- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
    // Get the new view controller using [segue destinationViewController].
    // Pass the selected object to the new view controller.
}
*/

@end
